#parse("/user/admin/inc/top.htm")
<div class="clearfix"></div>
<div class="MainPannel">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="38" align="center"><table width="98%" height="34" border="0" cellpadding="0" cellspacing="0">
          <tr>
              <td width="40" align="right"><img src="/images/list.gif" width="32" height="32" /></td>
              <td class="titletxt">编辑文章</td>
          </tr>
        </table></td>
    </tr>
</table>
<script language="JavaScript" src="/js/forbidNew.js" type="text/JavaScript"></script>
<script type="text/javascript" src="/js/swfobject.js"></script>
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript" src="/ckeditor/_samples/sample.js"></script>
<script language="JavaScript" type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(function(){
	$('#content').ckeditor();
});

function submitForm(){$('#frmDemo').submit();}

function doSave()
{
	//alert(getDisplayTime());
	EditForm.displaytime.value=getDisplayTime();
	if(!doCheck()){
		return false;
	}
}

function doDel(){
	if(EditForm.cid.value!=""){
		if(confirm("信息删除后不能恢复，请问要执行删除操作吗？")){
			EditForm.parameter.value="manageDel";
			EditForm.submit();
		}
	}else{
		alert("请选择要删除的数据");
	}
}

function doCheck(){
	if(EditForm.title.value==""){
		alert("标题不能为空!");
		EditForm.title.focus();
		return false;
	}
	if(EditForm.intro.value==""){
		alert("文章简介不能为空!");
		EditForm.intro.focus();
		return false;
	}
	if(EditForm.intro.value.length>500){
		alert("文章简介不能超过500字!");
		EditForm.intro.focus();
		return false;
	}
	return true;
}

function doUpload(obj,upFrame,types){
	upFrame.EditForm.subCommand.value="NewsContent";
	if(upFrame.EditForm.file.value!=""){
		upFrame.EditForm.parentObj.value=obj.name;
		upFrame.EditForm.types.value=types;
		upFrame.EditForm.submit();
	}
}

function addAttach(type,value)
{
//alert(obj.value);
var obj;
if(type=="imgs")obj=EditForm.imgs;
else obj=EditForm.files;
if(obj.value.indexOf(value)<0){
	if(obj.value!="")obj.value+=","+value;
	else obj.value=value;
}
}

function addOptions(obj,value,text){
	alert(value);
	var sel=eval("EditForm."+obj);
	for(var i=0;i<sel.options.length;i++){
		if(sel.options[i].text==text)sel.options[i]=null;
	}
	var it=new Option(text,value);
	sel.options[sel.options.length]=it;
}
function insertImgs()
{
//alert(EditForm.imgsSelect.value);
var imgPath=EditForm.imgsSelect.value;
htmlEdit.insertHTML("<img src='/upfile/"+imgPath+"' border=0>");
}
function changeDetailSetting(){
	detailSetting.style.display=(detailSetting.style.display=="none"?"":"none");
}
</script>
  <form id="EditForm" name="EditForm" method="post" action="/blogNewsDoc.do" onsubmit="return doSave();">
    <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="40" align="center" valign="middle">
        <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td width="5">&nbsp;</td>
              <td align="left" valign="middle">
								<input type="submit" name="Submit" value="保存" class="colorButton" />
                <input type="reset" name="Reset" value="重置" class="colorButton" />
								<input type="button" name="Cancel" value="取消" class="colorButton" onclick="history.back(-1)" />
							</td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td align="center" valign="top">
					#if($cid)
					<input type="hidden" name="parameter" value="update"/>
					#else
					<input type="hidden" name="parameter" value="add"/>
					#end
          <input type="hidden" name="cid"   value="$!cid">
          <table width="100%" border="0" cellpadding="1" cellspacing="0" align="center">
            <tr>
              <td align="right">标 题</td>
              <td align="left"><font color="#FF0000">
                <input name="title" type="text" id="title" value="$!title" style="width:80%" />*</font>(100字内)</td>
            </tr>
            <tr>
              <td align="right">分 类</td>
              <td align="left">
								<select name="dirsn" id="dirsn">
                  <option value="">默认分类</option>
                  $!TagUtil.options($dirService.queryBlogNewsDir($!currentUser.userName,1,20).result,"cid","title",$dirsn)
                </select>
								<div style="display:none">
                <select id="circlesn" name="circlesn">
									<option value="">发表到圈子</option>
									$ ! TagUtil.options($circleService.queryAllUserCircle($currentUser.userName).result,"cid","title",$circlesn)
								</select>
								</div>
                发布时间:
                <input type="text" class="Wdate" name="displaytime" value="$!displaytime" onfocus="WdatePicker({skin:'blue',maxDate:'%y-%M-%d'})" />
								来 源:
								<input name="source" type="text" id="source" value="$!source" />
                </td>
            </tr>
            <tr>
              <td align="right">评 论</td>
              <td align="left">
								<input id="review1" type="radio" name="review" value="1"
												#if($enablereview==1&&$guestreview==1)
													checked
												#end
												/>
                <label for="review1">允许</label>
                <input id="review2" type="radio" name="review" value="0"
													#if($enablereview==1&&$guestreview==-1)
												checked
												#end
													/>
                <label for="review2">不允许匿名</label>
                <input id="review3" type="radio" name="review" value="-1"
													#if($enablereview==-1)
												checked
												#end
													/>
                <label for="review3">禁止</label></td>
            </tr>
            <tr>
              <td align="right" valign="top">简 介</td>
              <td align="left"><textarea name="intro" rows="3" id="textarea" style="width:80%;font-size:12px">$!intro</textarea >
                <font color="red">*<span style="display:none;" id="error_info">超过了500字</span></font>(500字内)</td>
            </tr>
            <tr>
              <td align="center" valign="top" colspan="2"><textarea name="content" id="content" style="width:100%">$!content</textarea></td>
            </tr>
          </table></td>
      </tr>
    </table>
  </form>
	<div class="clearfix"></div>
</div>
#parse("/user/admin/inc/bottom.htm")
</body>
</html>
#if ($msg)
<script>
alert('$!msg');</script>
#end